﻿// FATBEntry.cs:
/// Datastructure for FATB entry in NARC data.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License.
// See LICENSE for more information.

using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;

namespace SharpNitroLib.NARC
{
	/// <summary>
	/// Datastructure for FATB entry in NARC data.
	/// </summary>
	[StructLayout(LayoutKind.Sequential)]
	public struct FATBEntry
	{
	
		/// <summary>
		/// Start offset of file.
		/// </summary>
	    public uint Start;
	    /// <summary>
	    /// End offset of file.
	    /// </summary>
	    public uint End;
	
	    /// <summary>
	    /// 
	    /// </summary>
	    public uint Size
	    {
	        get
	        {
	        	// Check for invalid start offset.
	        	if (End < Start)
	        		return 0;
	        	
	            return End - Start;
	        }
	    }
	}
}
